<%@ page language="java" contentType="text/html; charset=utf-8" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Date" %>
<%@ page import="net.zdsoft.keel.util.DateUtils" %>
<%@ page import="net.zdsoft.wpchat.support.dto.FileDto" %>
<%@ page import="net.zdsoft.wpchat.support.action.advanced.LogAction" %>
<%@ page import="net.zdsoft.wpchat.support.util.PageUtils" %>
<%@ page import="net.zdsoft.wpchat.support.client.UserAuth" %>
<%
LogAction action = (LogAction) PageUtils.getAction();
List<FileDto> logList = action.getLogDtos();
UserAuth userAuth = PageUtils.getUserAuth();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN" xml:lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css" media="all">@import url("../../css/style.css");</style>
<script type="text/javascript" language="javascript" src="../../script/sort.js"></script>
</head>
<body>
<div id="tableMain">
  <div id="message"><%=PageUtils.errors(action)%></div>
  <div id="pageNumber"></div>
  <table id="dataTable" border="0" align="center" cellpadding="5" cellspacing="1">
    <thead>
      <tr class="titleTr" style="cursor:hand">
        <td align="center">文件名</td>
        <td align="center">文件大小</td>
        <td align="center">最后修改时间</td>
        <% if (userAuth.canRemove()){ %>
        <td align="center">删除</td>
        <% }%>
        <% if (userAuth.canDo("download")){ %>
        <td align="center">下载</td>
        <%} %>
      </tr>
    </thead>
    <tbody>
    <% for (FileDto log : logList) { %>
      <tr>
        <td align="left"><%=log.getName() %></td>
        <td align="right"><%=log.getLength() %> <%=log.getUnit()%></td>
        <td align="center"><%=DateUtils.date2StringByMinute(new Date(log.getLastModified()))%></td>
        <% if (userAuth.canRemove()) { %>
        <td align="center"><a href="removeLog.htm?logName=<%=log.getName() %>" title="删除" onclick="return confirm('你确定要删除此日志吗')"><img src="../../images/delete.gif" width="16" height="16" border="0" /></a></td>
        <% } %>
        <%if (userAuth.canDo("download")) { %>
        <td align="center"><a href="downloadLog.htm?logName=<%=log.getName() %>" target="_blank" title="下载"><img src="../../images/download.gif" width="18" height="17" border="0" /></a></td>
        <% } %>
      </tr>
      <% } %>
    </tbody>
  </table>
</div>
</body>
</html>
